package Demo1.a01demo1;

import java.util.ArrayList;
import java.util.Scanner;

public class Test1 {
    public static void main(String[] args) {
        ArrayList<Integer> list = new ArrayList<>();
        int sum = 0;
        Scanner sc = new Scanner(System.in);
        for (int i = 0; i < 100; i++) {
            if (sum <= 200) {
                int number = sc.nextInt();
                list.add(number);
                sum += number;
            } else {
                break;
            }
        }
        System.out.println(sum);
        for (int i = 0; i < list.size(); i++) {
            System.out.println(list.get(i));
        }
    }
}
